package cn.edu.sdjzu.xg.bysj.domain;

import cn.edu.sdjzu.xg.bysj.domain.authority.Actor;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

@ToString
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class User implements Comparable<User>, Serializable {
    private Integer id;
    private String username;
    private String password;
    private LocalDateTime loginTime;
    private Actor actor;

    public User(String username, String password, LocalDateTime loginTime, Actor actor) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.loginTime = loginTime;
        this.actor = actor;
    }

    public User(Integer id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }

    @Override
    public int compareTo(User o) {
        // TODO Auto-generated method stub
        return this.id - o.id;
    }

}